import re
import sys

timestamp = None
state = 0
krw = None
usdt = None

print('timestamp,currency,passive,reserved')

for line in sys.stdin:
  if state == 0:
    if line.startswith('* 2018'):
      timestamp = line[2:-1]
      state = 1
  elif state == 1:
    if line.startswith('  *'):
      state = 0
    else:
      splitted = re.split('\ +', line)
      assert len(splitted) == 9, len(splitted)
      state = 2
  elif state == 2:
    assert line.startswith('---')
    state = 3
  elif state == 3:
    splitted = re.split('\ +', line)
    quote = None
    if line.startswith('KRW: '):
      quote = 'KRW'
    elif line.startswith('EUR: '):
      quote = 'EUR'
    elif line.startswith('USDT: '):
      quote = 'USDT'
    elif line.startswith('USD: '):
      quote = 'USD'
    if quote is not None:
      splitted = re.split('\ +', line)
      krw = float(splitted[5][:-1])
      print('"%s",%s,%f,%f' % (timestamp, 'Adjusted%s' % quote, krw, krw))
      state = 0
      continue
    if len(splitted) == 8:
      splitted = [''] + splitted
    if len(splitted) == 9:
      upbit = float(splitted[2])
      currency = splitted[1]
      reserved = float(splitted[4])
      print('"%s",%s,%f,%f' % (timestamp, currency, upbit, reserved))
